<div class="main device-info">
  <div class="main-header">
    <div class="pa-icon-div pull-left fs-14">
      <i class="iconfont icon-shouye fs-14 icon-vertical-top"></i>
      <span class="fs-vertical-middle">工作台>船机设备>
      <span class="fs-theme-color">设备信息</span>
      </span>
    </div>
  </div>
  <div class="main-content">
    <div class="search-info">
      <div class="container-header fs-16">
        <span>设备信息列表</span>
      </div>
      <form class="base-info" name="queryForm">
        <div class="base-info-item">
          <div class="pa-form-control">
            <label>设备名称：</label>
            <input type="text" class="pa-form-control-input"
              ng-model="vm.mapParams.deviceName">
          </div>
          <div class="pa-form-control">
            <label>设备编码：</label>
            <input type="text" class="pa-form-control-input"
              ng-model="vm.mapParams.code">
          </div>
          <div class="pa-form-control">
            <label>进场时间：</label>
            <input type="text" class="pa-form-control-input date-picker"
              name="inTimeMin"
              data-ng-datepicker
              ng-model="vm.mapParams.inTimeMin">
            <label class="pa-form-zhi">至</label>
            <input type="text" class="pa-form-control-input date-picker"
              name="inTimeMax"
              data-ng-datepicker
              ng-model="vm.mapParams.inTimeMax">
          </div>
          <div class="pa-form-control-btn">
            <button class="pa-btn pa-sw-btn" type="button"
              ng-click="vm.$query(queryForm)">搜索</button>
            <button class="pa-btn pa-sw-btn reset-btn" type="reset"
              ng-click="vm.$reset()">重置</button>
          </div>
        </div>
      </form>
    </div>
    <div class="pa-fl">
      <div class="pa-operate-fr fs-theme-color"
        ui-sref="addDeviceInfo">
        <i class="iconfont icon-dengji icon-middle fs-14"></i>
        <span>设备登记</span>
      </div>
      <div class="pa-operate-fr fs-theme-color"
        ng-click="vm.$intoRegistration(vm)">
        <i class="iconfont icon-tuichu1 icon-middle fs-14"></i>
        <span>进场登记</span>
      </div>
      <div class="pa-operate-fr fs-theme-color"
        ng-click="vm.$outRegistration(vm)">
        <i class="iconfont icon-tuichu icon-middle fs-14"></i>
        <span style="vertical-align: middle;">出场登记</span>
      </div>
      <div class="pa-operate-fr fs-theme-color"
        ng-click="vm.$printQrCode(vm)">
        <i class="iconfont icon-ordinaryprint icon-middle fs-14"></i>
        <span>二维码打印</span>
      </div>
      <div class="play-hide-operate fr fs-14">
        <label>出场隐藏：</label>
        <input class="radio-radius" type="radio" name="pa-radio" value="1"
          ng-checked="true"
          ng-model="vm.mapParams.inOutStatus"
          ng-change="vm.$paginationQuery()">是
        <input class="radio-radius" type="radio" name="pa-radio" value=""
          ng-checked="true"
          ng-model="vm.mapParams.inOutStatus"
          ng-change="vm.$paginationQuery()">否
      </div>
    </div>
    <pa-table>
      <table class="pa-table">
        <thead>
          <tr>
            <th class="checkbox-radius">
              <input type="checkbox"
                ng-model="vm.toggleAllFlag"
                ng-click="vm.$toggleAll()">
            </th>
            <th class="sorting"
              ng-class="{'sorting-desc': vm.mapParams.sortType == 2, 'sorting-asc': vm.mapParams.sortType == 1}"
              ng-click="vm.$toggleOrder('number')">
              设备编码
            </th>
            <th>设备名称</th>
            <th>设备分类</th>
            <th>使用地点</th>
            <th>状态</th>
            <th>进场时间</th>
            <th>出场时间</th>
            <th class="operate-three">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="item in vm.equipListData">
            <td>
              <input type="checkbox"
                ng-model="item.checked"
                ng-change="vm.$isChange()">
            </td>
            <td>{{item.code}}</td>
            <td>{{item.deviceName}}</td>
            <td>{{vm.getDeviceCategory(item.catgegroy)}}</td>
            <td>{{item.useLocationName}}</td>
            <td>{{item.inOutStatus == 1 ? '在场' : item.inOutStatus == 2 ? '离场' : '-'}}</td>
            <td>{{item.inTime | date:"yyyy-MM-dd"}}</td>
            <td>{{item.outTime | date:"yyyy-MM-dd"}}</td>
            <td>
              <div class="operate-del" ui-sref="deviceInfoDetail({id: item.id})">
                <i class="iconfont icon-middle icon-jilu3 detail-color fs-12"></i>
                <span>详情</span>
              </div>
              <div class="operate-del" ui-sref="editDeviceInfo({id: item.id})">
                <i class="iconfont icon-middle icon-xiugai1 edit-color fs-12"></i>
                <span>修改</span>
              </div>
              <div class="operate-del" ng-click="vm.$delete(item.id)">
                <i class="iconfont icon-middle icon-shanchu trash-color fs-12"></i>
                <span>删除</span>
              </div>
            </td>
          </tr>
        </tbody>
      </table>
    </pa-table>
  </div>
</div>

<!-- confirm 进场弹窗 -->
<script type="text/ng-template" id="paEquipIntoRegistrationDialog">
  <div class="pa-dialog">
    <div class="pa-dialog-header">
      <div class="title-txt">
        <span>设备进场</span>
      </div>
    </div>
    <div class="pa-dialog-content text-center">
      <div class="pa-form-control pa-width-100">
        <label class="text-right ">进场时间：</label>
        <input type="text" class="hidden-input" autofocus="true">
        <input type="text" class="pa-form-control-input date-picker"
          data-ng-datepicker
          ng-model="vm.recordTime">
      </div>
    </div>
    <div class="pa-dialog-footer text-center">
      <a class="pa-btn" ng-click="vm.sureBtnFn()">
        <span>确定</span>
      </a>
      <a class="pa-btn reset-btn" ng-click="closeThisDialog()">
        <span>取消</span>
      </a>
    </div>
  </div>
</script>

<!-- confirm 出场弹窗 -->
<script type="text/ng-template" id="paEquipOutRegistrationDialog">
  <div class="pa-dialog">
    <div class="pa-dialog-header">
      <div class="title-txt">
        <span>设备出场</span>
      </div>
    </div>
    <div class="pa-dialog-content text-center">
      <div class="pa-form-control pa-width-100">
        <label class="text-right ">出场时间：</label>
        <input type="text" class="hidden-input" autofocus="true">
        <input type="text" class="pa-form-control-input date-picker"
          data-ng-datepicker
          ng-model="vm.recordTime">
      </div>
    </div>
    <div class="pa-dialog-footer text-center">
      <a class="pa-btn" ng-click="vm.sureBtnFn()">
        <span>确定</span>
      </a>
      <a class="pa-btn reset-btn" ng-click="closeThisDialog()">
        <span>取消</span>
      </a>
    </div>
  </div>
</script>

<script type="text/ng-template" id="equipInfoQrCodePrintDialog">
  <div class="pa-dialog">
    <div class="pa-dialog-header">
      <div class="title-txt">
        <span>二维码打印</span>
      </div>
    </div>
    <div class="pa-dialog-content text-center">
      <div class="qr-print-scroll-outer">
        <!-- <div class="qr-print" style="width: 300px;">
          <div class="qr-item" style="width: 300px;height: 225px; overflow: hidden; word-wrap: break-word;"
            ng-repeat="item in vm.selectedEquipList">
            <table class="qr-info" style="width: 100%; height: 100%;">
              <tr>
                <td class="qr-info" style="font-size: 22px;font-weight: 600;text-align: right;">
                  <div style="width: 120px;word-wrap: break-word;padding-right: 6px;">
                    {{::item.deviceName || '-'}}
                  </div>
                  <div style="width: 120px;word-wrap: break-word;padding-right: 6px;">
                    {{item.catgegroy == 1 ? '一般设备' :
                    item.catgegroy == 2 ? '主要设备' :
                    item.catgegroy == 3 ? '关键设备' :
                    item.catgegroy == 4 ? '特种设备' : '-'}}
                  </div>
                  <div style="width: 120px;word-wrap: break-word;padding-right: 6px;">
                    {{::item.useLocationName || '-'}}
                  </div>
                  <div style="width: 120px;word-wrap: break-word;padding-right: 6px;">
                    {{::item.tenderCode || '-'}}
                  </div>
                </td>
                <td class="qr-img" style="text-align: center; width: 160px; ">
                  <img style="width:160px; height: 160px; " ng-src="{{vm.getQrCodeSrc(item)}}">
                </td>
              </tr>
            </table>
          </div>
        </div> -->
        <div class="qr-print" style="width: 380px; margin: auto;">
          <div class="qr-item" style="width: 100%;height: 184px;padding: 10px 0; overflow: hidden; word-wrap: break-word;"
            ng-repeat="item in vm.selectedEquipList">
            <div style="color: #000;font-size: 22px;text-align: center;">{{item.projectName}}</div>
            <div style="overflow: hidden;">
              <img ng-src="{{vm.getQrCodeSrc(item)}}" style="float: left;width: 130px;">
              <div style="margin-left: 130px;padding: 15px 10px 10px 0;color: #000;text-align: left;">
                <div style="font-size: 26px;font-weight: 800;line-height: 1.3;">名称：{{item.deviceName}}</div>
                <div style="font-size: 26px;font-weight: 800;line-height: 1.3;">
                  分类：{{item.catgegroy == 1 ? '一般设备' :
                  item.catgegroy == 2 ? '主要设备' :
                  item.catgegroy == 3 ? '关键设备' :
                  item.catgegroy == 4 ? '特种设备' : ''}}</div>
                <div style="font-size: 26px;font-weight: 800;line-height: 1.3;">部位：{{item.useLocationName}}</div>
              </div>
            </div>
           <div style="text-align: right;padding: 10px 15px;color: #000;font-weight: 600;margin-top: -10px;
            ">{{item.orgName}}</div>
          </div>
        </div>
      </div>
    </div>
    <div class="pa-dialog-footer text-center">
      <a class="pa-btn" ng-click="vm.print()">
        <span class="ml5">打印</span>
      </a>
      <a class="pa-btn reset-btn" ng-click="closeThisDialog()">
        <span class="ml5">取消</span>
      </a>
    </div>
  </div>
</script>